using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using System.Data;

namespace ERP.Reports
{
    public partial class rptNhapkho : DevExpress.XtraReports.UI.XtraReport
    {
        public DataTable ds_BaoCao = null;
        public DataTable dsHoadon = null;
        public string ban = "";
        public string donvi = "";
        public string diachi = "";
        public string bangchu = "";

        public rptNhapkho()
        {
            InitializeComponent();
        }
        public void In()
        {
            this.InBaoCao(this.ds_BaoCao);
            //this.tienHD(this.dsHoadon);
            this.lbNhanhoadon.Text = this.ban;
            this.lbDonvi.Text = this.donvi;
            this.lbDiachi.Text = this.diachi;
            //this.lbBangchu.Text = this.bangchu;
        }
        //private void tienHD(DataTable dsReport)
        //{
        //    try
        //    {
        //        this.lbTong.Text = dsReport.Rows[0]["tongtien"].ToString().Trim();
        //        this.lbKhuyenmai.Text = dsReport.Rows[0]["khuyenmai"].ToString().Trim();
        //        this.lbConlai.Text = dsReport.Rows[0]["conlai"].ToString().Trim();
        //    }
        //    catch { }
        //    //this.lbThanhtoan.Text = dsReport.Rows[0]["datra"].ToString().Trim();
        //    //this.lbConno.Text = dsReport.Rows[0]["conno"].ToString().Trim();
        //}

        private void InBaoCao(DataTable dsReport)
        {

            this.DataSource = dsReport;

            this.txtSott.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", dsReport,"stt")});

            this.txtTenmon.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", dsReport,"tenhh")});

            this.txtDvt.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", dsReport,"donvitinh")});

            this.txtDongia.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", dsReport,"dongia", "{0:#,#}")});

            this.txtSoluong.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", dsReport,"soluong", "{0:#,#}")});

            this.txtThanhtien.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", dsReport,"thanhtien","{0:#,#}")});


        }
    }
}
